package org.kfive.nova.io.netty;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;

import java.util.Random;

/**
 * Created by admin on 2017-05-17.
 */
public class ByteBufTest {
    public static void main(String[] args) {
        Random random = new Random();
        ByteBuf buf = Unpooled.buffer();
        while(buf.isWritable()){
            buf.writeByte(random.nextInt());
        }
        while(buf.isReadable()){
            System.out.println(buf.readByte());
        }
    }
}
